
class SystemLocalStorage {
    constructor() {
        this.prefix = "MSAC_";
        this.idDic= this.idDic();
        /**
         * @param {*} locale 客户端语言
         */
        this._locale = navigator.language.split('-')[0];
    }
    idDic() {
        return {
            locale: "localLocale"
        }
    }
    getId(key) {
        return this.prefix + this.idDic[key];
    }
    get locale() {
        this._locale = localStorage.getItem(this.getId("locale"))?JSON.parse(localStorage.getItem(this.getId("locale"))) : this._locale;
        return this._locale;
    }
    set locale(data) {
        localStorage.setItem(this.getId("locale") , JSON.stringify(data));
    }
}